pub struct Todo {
    pub description: String,
    pub completed: bool,
}

impl Todo {
    pub fn new(desc: &str) -> Self {
        Todo {
            description: desc.to_owned(),//&str convert to String
            completed: false,
        }
    }

    pub fn toggle(&mut self) {
        self.completed = !self.completed;
    }
}
